from myelin.Ns import MYELIN
from nodetypes.formats.mml.Events import ResetEventHandler

from nodetypes.services.TextSearchConfig import Serializer as ConfigSerializer

from forms import Reset

class EventHandler(ResetEventHandler):
    
    newResetForm            = Reset.Form
    
    newConfigSerializer     = ConfigSerializer
    
    def process(self, context, source):
        eventData = context.event.data            
        eventData.config = self.newConfigSerializer().deserialize(source.asInputSource())
        print "CONFIG: ", self.newConfigSerializer().serialize(eventData.config).xml()
        return super(EventHandler,self).process(context, source)